# [1, 5]
# [8, 10]

# 编写一个表示圆形的类，它有一个计算周长和面积的方法。
class Circle:
    def __init__(self, radius: int):
        self.radius = int(radius)
    def get_circumference(self) -> int:
        return int(2 * 3.14 * self.radius)

# 
# list1 = [2, 4, 7, 9]
#                      ^i1
# list2 = [1, 3, 5, 8, 11]
#                   ^i2

#  diff = abs(list1[i1] - list2[i2]) = 2
#  smallest = 1

# 1. Sort the two lists

# smallest_difference(list1 = [2, 5, 7, 9], list2 = [1, 3, 5, 8, 11]) -> (5, 5)


def smallest_difference(list1: list, list2: list) -> tuple:
    l1 = 0
    l2 = 0
    list1.sort()
    list2.sort()
    difference = 0
    if list1[l1] > list2[l2]:
        difference = list1[l1] - list2[l2]
        l2 += 1
    elif list2[l2] > list1[l1]:
        difference = list2[l2] - list1[l1]
        l1 += 1
    else:
        return (list1[l1], list2[l2])

    while True:

        if list1[l1] > list2[l2]:
            difference = min(difference, list1[l1] - list2[l2])
            l2 += 1

        if list2[l2] > list1[l1]:
            difference = min(difference, list2[l2] - list1[l1])
            l1 += 1

        if list1[l1] == list2[l2]:
            return (list1[l1], list2[l2])

        if l1 > len(list1):
            return (list1[l1 - 1], list2[l2])

        elif l2 > len(list2):
            return (list1[l1], list2[l2 - 1])

